/**
 * Unicorn Admin Template
 * Diablo9983 -> diablo9983@gmail.com
**/
$(document).ready(function(){
	
	
	// === Prepare the chart data ===/
	var sin = [], cos = [];
    // for (var i = 0; i < 14; i += 0.5) {
    //     sin.push([i, Math.sin(i)]);
    //     cos.push([i, Math.cos(i)]);
    // }
    // console.log(sin);

    // sin = [ [0,0], [1,1], [2,2]];
    sin = [ [30, 15.02.2012], [28, 16.02.2012]];

	// === Make chart === //
    var plot = $.plot($(".chart"),
           [ { data: sin, label: "sin(x)", color: "#BA1E20"}, { data: cos, label: "cos(x)",color: "#459D1C" } ], {
               series: {
                   lines: { show: true },
                   points: { show: true }
               },
               grid: { hoverable: true, clickable: true },
               yaxis: { min: -3, max: 5 }
		   });
    
	
});


unicorn = {
		// === Tooltip for flot charts === //
		flot_tooltip: function(x, y, contents) {
			
			$('<div id="tooltip">' + contents + '</div>').css( {
				top: y + 5,
				left: x + 5
			}).appendTo("body").fadeIn(200);
		}
}
